//
//  MyCommissionViewController.m
//  EarnCommision
//
//  Created by Nancy on 3/15/15.
//  Copyright (c) 2015 EC. All rights reserved.
//

#import "MyCommissionViewController.h"
#import "UIViewExt.h"
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
#define kScreenWidth [UIScreen mainScreen].bounds.size.width

@interface MyCommissionViewController ()
@property (nonatomic,strong) UIView *commissionInfo;
@property (nonatomic,strong) UIButton *costBtn;
@property (nonatomic,strong) UIButton *gainBtn;
@property (nonatomic,strong) UILabel *infoLabel;
@property (nonatomic,strong) UILabel *scatteredRankLabel;
@property (nonatomic,strong) UILabel *scatteredRank;
@property (nonatomic,strong) UILabel *gainRankLabel;
@property (nonatomic,strong) UILabel *gainRank;
@property (nonatomic,strong) UILabel *costCommissionLabel;
@property (nonatomic,strong) UILabel *gainCommissionLabel;
@property (nonatomic,strong) UILabel *costCommissionNum;
@property (nonatomic,strong) UILabel *gainCommissionNum;

@end


@implementation MyCommissionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    self.title = @"我的佣金";
    [self.view setBackgroundColor:[UIColor whiteColor]];
    _commissionInfo = [[UIView alloc]initWithFrame:CGRectMake(0, 66, kScreenWidth, kScreenHeight/2-140)];
    [_commissionInfo setBackgroundColor:[UIColor colorWithRed:74/255.0 green:202/255.0 blue:229/255.0 alpha:1.0]];
    [self.view addSubview:_commissionInfo];
    
    _infoLabel = [[UILabel alloc]initWithFrame:CGRectMake(30, 30, kScreenWidth-30, 50)];
    _infoLabel.textColor = [UIColor whiteColor];
    _infoLabel.text = @"综合";
    [_infoLabel setFont:[UIFont fontWithName:nil size:30]];
    [_commissionInfo addSubview:_infoLabel];
    
    _scatteredRankLabel = [[UILabel alloc]initWithFrame:CGRectMake(_infoLabel.left, _infoLabel.bottom+20, kScreenWidth-60, 20)];
    _scatteredRankLabel.textColor = [UIColor whiteColor];
    _scatteredRankLabel.text = @"我在此平台上'散金办事'排名:";
    [_scatteredRankLabel setFont:[UIFont fontWithName:nil size:20]];
    [_commissionInfo addSubview:_scatteredRankLabel];
    
    _scatteredRank = [[UILabel alloc]initWithFrame:CGRectMake(_scatteredRankLabel.right, _scatteredRankLabel.top, 30, 20)];
    _scatteredRank.textColor = [UIColor whiteColor];
    _scatteredRank.text = @"1/1";
    [_scatteredRank setFont:[UIFont fontWithName:nil size:20]];
    [_commissionInfo addSubview:_scatteredRank];
    
    _gainRankLabel = [[UILabel alloc]initWithFrame:CGRectMake(_infoLabel.left, _scatteredRank.bottom+20, kScreenWidth-60, 20)];
    _gainRankLabel.textColor = [UIColor whiteColor];
    _gainRankLabel.text = @"我在此平台上'办事赚金'排名:";
    [_gainRankLabel setFont:[UIFont fontWithName:nil size:20]];
    [_commissionInfo addSubview:_gainRankLabel];
    
    _gainRank= [[UILabel alloc]initWithFrame:CGRectMake(_gainRankLabel.right, _gainRankLabel.top, 30, 20)];
    _gainRank.textColor = [UIColor whiteColor];
    _gainRank.text = @"1/1";
    [_gainRank setFont:[UIFont fontWithName:nil size:20]];
    [_commissionInfo addSubview:_gainRank];
    
    _costBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, _commissionInfo.bottom, kScreenWidth/2, 100)];
    [_costBtn setBackgroundColor:[UIColor colorWithRed:54/255.0 green:220/255.0 blue:203/255.0 alpha:1.0]];
    [self.view addSubview:_costBtn];
    
    _gainBtn = [[UIButton alloc]initWithFrame:CGRectMake(_costBtn.right, _commissionInfo.bottom, kScreenWidth/2, 100)];
    [_gainBtn setBackgroundColor:[UIColor colorWithRed:238/255.0 green:188/255.0 blue:81/255.0 alpha:1.0]];
    [self.view addSubview:_gainBtn];
    
    _costCommissionNum = [[UILabel alloc]initWithFrame:CGRectMake(0, 20, _costBtn.width, 20)];
    _costCommissionNum.textAlignment = NSTextAlignmentCenter;
    _costCommissionNum.textColor = [UIColor whiteColor];
    _costCommissionNum.text = [NSString stringWithFormat:@"-￥%@",@"0.0"];
    [_costBtn addSubview:_costCommissionNum];
    
    
    _costCommissionLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, _costCommissionNum.bottom+20, _costBtn.width, 20)];
    _costCommissionLabel.textAlignment = NSTextAlignmentCenter;
    _costCommissionLabel.textColor  = [UIColor whiteColor];
    _costCommissionLabel.text = @"佣金花费";
    [_costBtn addSubview:_costCommissionLabel];
    
   
    _gainCommissionNum = [[UILabel alloc]initWithFrame:CGRectMake(0, 20, _gainBtn.width, 20)];
    _gainCommissionNum.textAlignment = NSTextAlignmentCenter;
    _gainCommissionNum.textColor = [UIColor whiteColor];
    _gainCommissionNum.text = [NSString stringWithFormat:@"-￥%@",@"0.0"];
    [_gainBtn addSubview:_gainCommissionNum];
    
    
    _gainCommissionLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, _costCommissionNum.bottom+20, _costBtn.width, 20)];
    _gainCommissionLabel.textAlignment = NSTextAlignmentCenter;
    _gainCommissionLabel.textColor  = [UIColor whiteColor];
    _gainCommissionLabel.text = @"佣金收取";
    [_gainBtn addSubview:_gainCommissionLabel];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
